#include "ObjectStructure.h"
#include "Element.h"
#include "Visitor.h"

using namespace std;

ObjectStructure::ObjectStructure(){

}

ObjectStructure::~ObjectStructure(){

}

void ObjectStructure::Attach(Element* element){
	_elements.push_back(element);
}

void ObjectStructure::Detach(Element* element){
	_elements.remove(element);
}

void ObjectStructure::Accept(Visitor* visitor){
	list<Element*>::iterator itor;
	itor=_elements.begin();
	while(itor!=_elements.end()){
		(*itor)->Accept(visitor);
		itor++;
	}
}